//using IM.Easy.Infrastructure.Query;
//using Microsoft.AspNetCore.Mvc;
//using IM.Easy.SystemServices.Dtos;
//using IM.Easy.SystemServices.IServices;
//using IM.Easy.Entity.System;
//using IM.Easy.Workflow.IServices;
//using IM.Easy.Entity.Workflow;
//using IM.Easy.Workflow.Dtos;
//using IM.Easy.Core.Attributes;

//namespace IM.Easy.Api.Controllers.System
//{
//    /// <summary>
//    /// WorkflowTaskController 控制器
//    /// </summary>
//    [Route("workflow/task")]
//    public class WorkflowTaskController : ControllerBase
//    {
//        private readonly IWorkflowTaskService _service;

//        /// <summary>
//        /// 构造函数，注入服务
//        /// </summary>
//        /// <param name="service">服务接口</param>
//        public WorkflowTaskController(IWorkflowTaskService service)
//        {
//            _service = service;
//        }

//        /// <summary>
//        /// 获取所有WorkflowTask对象
//        /// </summary>
//        /// <returns>返回WorkflowTask列表</returns>
//        [HttpGet]
//        public PageResponse<WorkflowTask> GetList([FromQuery] WorkflowTaskQueryDto query)
//        {
//            return _service.GetPageList(query);
//        }

//        /// <summary>
//        /// 根据ID获取WorkflowTask对象
//        /// </summary>
//        /// <param name="id">对象的ID</param>
//        /// <returns>返回指定的WorkflowTask对象</returns>
//        [HttpGet("{id}")]
//        public WorkflowTask GetById([FromRoute] Guid id)
//        {
//            var result = _service.GetById(id);
//            return result ?? throw new KeyNotFoundException($"未找到ID为 {id} 的WorkflowTask对象。");
//        }

//        /// <summary>
//        /// 发起流程
//        /// </summary>
//        /// <param name="entity">要创建的WorkflowTask对象</param>
//        /// <returns>返回创建后的WorkflowTask对象</returns>
//        [HttpPost]
//        [Api(Name = "发起流程", Perm = "workflow:task:add")]
//        public async Task<WorkflowTask> Create([FromBody] WorkflowTaskCreateDto createDto)
//        {
//            var task = await _service.Create(createDto);
//            return task; // 直接返回创建的实体
//        }

//        /// <summary>
//        /// 更新现有的WorkflowTask对象
//        /// </summary>
//        /// <param name="id">对象的ID</param>
//        /// <param name="entity">更新后的WorkflowTask对象</param>
//        [HttpPut]
//        public void Update([FromBody] WorkflowTask entity)
//        {
//            _service.Update(entity);
//        }

//        /// <summary>
//        /// 批量删除WorkflowTask对象
//        /// </summary>
//        /// <param name="ids">对象的IDS</param>
//        [HttpDelete]
//        public void Delete([FromBody] Guid[] ids)
//        {
//            _service.Delete(ids);
//        }

//        /// <summary>
//        /// 单个删除WorkflowTask对象
//        /// </summary>
//        /// <param name="id">对象的ID</param>
//        [HttpDelete("{id}")]
//        public void Delete([FromRoute] Guid id)
//        {
//            _service.Delete(id);
//        }
//    }
//}
